package com.wanqing.controller.admin;

import com.wanqing.assistant.AdminAssistant;
import com.wanqing.assistant.pojo.AdminChat;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;

@RestController
@RequestMapping("/admin/assistant")
@Tag(name = "管理员助手")
@Slf4j
public class AdminAssistantController {
    @Autowired
    private AdminAssistant adminAssistant;

    @PostMapping(value = "/chat",produces = "text/stream;charset=utf-8")
    @Operation(summary = "对话")
    public Flux<String> chat(@RequestBody AdminChat adminChat) {
        Flux<String> chat = adminAssistant.chat(adminChat, adminChat.getContent());
        log.info("管理员助手对话: {}", chat);
        return chat;
    }
    @Operation(summary="图书库存量")
    @PostMapping("/bookStock")
    public void bookStock(@RequestBody AdminChat adminChat){

    }
    @Operation(summary="图书库存预警")
    @PostMapping("/bookStockWarning")
    public void bookStockWarning(@RequestBody AdminChat adminChat){

    }
    @Operation(summary="店铺营业额情况")
    @PostMapping("/getTurnover")
    public void getTurnover(@RequestBody AdminChat adminChat){

    }
    @Operation(summary="店铺用户情况")
    @PostMapping("/getUserStatistics")
    public void getUserStatistics(@RequestBody AdminChat adminChat){

    }
    @Operation(summary="店铺订单情况")
    @PostMapping("/getOrderStatistics")
    public void getOrderStatistics(@RequestBody AdminChat adminChat){

    }

    @Operation(summary="店铺销量前十排名")
    @PostMapping("/getSalesTop10")
    public void getSalesTop10(@RequestBody AdminChat adminChat){

    }

    @Operation(summary="智能下架图书")
    @PostMapping("/bookDisabled")
    public void bookDisabled(@RequestBody AdminChat adminChat){

    }

}
